package com.yu.xcx.controller;


import com.yu.xcx.dto.Result;
import com.yu.xcx.service.IFollowService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/follow")
public class FollowController {

    @Resource
    private IFollowService followService;

    @PostMapping("/add")
    public Result follow(@RequestParam ("user_id") Integer userId, @RequestParam ("follow_user_id") Integer followUserId,
                         @RequestParam("isFollow") Boolean isFollow) {
        return followService.follow(userId, followUserId, isFollow);
    }

    @GetMapping("/or/not")
    public Result isFollow(@RequestParam ("user_id") Integer userId, @RequestParam ("follow_user_id") Integer followUserId) {
        return followService.isFollow(userId, followUserId);
    }

    @GetMapping("/getCount")
    public Result getFollowCount(@RequestParam ("user_id") Integer userId){
        return followService.getFollowCount(userId);
    }


}
